﻿<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Microsoft.Samples.Office.UnifiedCommunications.Gadget"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2006" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    x:Class="Microsoft.Samples.Office.UnifiedCommunications.Gadget.VoiceMail"
    Title="VoiceMail"
    ShowsNavigationUI="False" 
    ClipToBounds="True" 
    mc:Ignorable="d">
    <Page.Resources>
        <Storyboard x:Key="LoadAni">
            <local:BackDoubleAnimation Completed="BackDoubleAnimation_Completed" From="300" To="0" Duration="0:0:0.8" EdgeBehavior="EaseOut" Amplitude=".5"   Suppression="0" DecelerationRatio=".5" Storyboard.TargetName="mainGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)"/>
        </Storyboard>
        <local:UnreadVoicemailConverter x:Key="unreadVoicemailConverter"/>
    </Page.Resources>
    <Page.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource LoadAni}"/>
        </EventTrigger>
    </Page.Triggers>

    <Grid x:Name="mainGrid">
        <Grid.RenderTransform>
            <TranslateTransform X="0" Y="0"/>
        </Grid.RenderTransform>
        <Border BorderThickness="1,1,1,1" BorderBrush="#FF333945" CornerRadius="9,9,9,9">
            <Border Width="Auto" Height="Auto" BorderBrush="#FF161D25" BorderThickness="1,1,1,1" CornerRadius="8,8,8,8">
                <Grid Width="Auto" Height="Auto" x:Name="ContentGrid">
                    <Rectangle Stroke="{x:Null}" RadiusX="8" RadiusY="8" Width="Auto" Height="Auto" MinHeight="380" MinWidth="280">
                        <Rectangle.Fill>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFDAE3EF" Offset="0"/>
                                <GradientStop Color="#FFE2EBF1" Offset="1"/>
                            </LinearGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                    <TextBlock VerticalAlignment="Top" Text="Voice Mail" TextWrapping="Wrap" FontFamily="Calibri" FontSize="16" FontWeight="Bold" Foreground="#FF3D4F73" d:LayoutOverrides="Width" HorizontalAlignment="Center" Margin="0,10,0,0"/>
                    
                    <Grid x:Name="gridContent">
                    	<Grid x:Name="gridVMConfiguration" Visibility="Collapsed" Margin="10,55,10,0" VerticalAlignment="Top">
                    		<StackPanel HorizontalAlignment="Center">
                    			<TextBlock x:Name="tbVMConfig" TextWrapping="Wrap" FontSize="16" FontFamily="Calibri" HorizontalAlignment="Center"/>
                    		</StackPanel>
                    	</Grid>

                    	<Grid x:Name="gridVoicemail" Visibility="Visible" Margin="0,30,0,0">
                    		<DockPanel VerticalAlignment="Stretch" Height="Auto">
                    			
                                <TextBlock x:Name="tbVoicemailCount" Width="Auto" Height="Auto" DockPanel.Dock="Top" HorizontalAlignment="Center" FontFamily="Calibri" FontSize="12" Margin="0,0,0,8"/>
                                  
                                <TextBlock Width="150" Height="20" DockPanel.Dock="Bottom" />
                                
                                <Grid Width="Auto" Height="Auto">
                                
                                    <ScrollViewer x:Name="myScrollViewer" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Auto" HorizontalAlignment="Stretch"  Background="#FFFFFFFF" FontFamily="Arial" FontSize="14" Foreground="#FF000000"   BorderBrush="{x:Null}" BorderThickness="0,0,0,0"  Margin="0,0,0,0"  Width="Auto">
                                    <ListBox x:Name="listBoxVM" BorderThickness="0px" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="Auto" Height="Auto" MouseDoubleClick="listBoxVM_MouseDoubleClick" >
                                        <ListBox.ItemTemplate>
	                                        <DataTemplate>
		                                        <Border BorderBrush="#dcdcdc" BorderThickness=" 0 0 0 1">
			                                        <Grid >
				                                        <Grid.ColumnDefinitions>
					                                        <ColumnDefinition MinWidth="160px"/>
					                                        <ColumnDefinition  Width="*"/>
				                                        </Grid.ColumnDefinitions>
                                                  
				                                        <Label Grid.Column="0" Content="{Binding Path=from}" FontSize="16" FontFamily="Calibri" FontWeight="Bold"
					                                        Foreground="{Binding Path=read, Converter={StaticResource unreadVoicemailConverter}, Mode=Default}"/>
				                                        <Label Grid.Column="1" HorizontalAlignment="Right"  Content="{Binding Path=received}" FontSize="14"  FontFamily="Calibri"
					                                        Foreground="{Binding Path=read, Converter={StaticResource unreadVoicemailConverter}, Mode=Default}"/>                                                  
			                                        </Grid>
		                                        </Border>
	                                        </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>
                                    </ScrollViewer>
                                    <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Top" Width="Auto" Height="7" Fill="{DynamicResource dropShadow}" StrokeThickness="0" />
                                    <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Width="Auto" Height="7" Fill="{DynamicResource dropShadowReverse}" StrokeThickness="0" RenderTransformOrigin="0.5,0.5" >
                                        <Rectangle.RenderTransform>
	                                        <TransformGroup>
		                                        <ScaleTransform ScaleX="1" ScaleY="1"/>
		                                        <SkewTransform AngleX="0" AngleY="0"/>
		                                        <RotateTransform Angle="180"/>
		                                        <TranslateTransform X="0" Y="0"/>
	                                        </TransformGroup>
                                        </Rectangle.RenderTransform>
                                    </Rectangle>                        
                    			</Grid>                        
                    		</DockPanel>
                    	</Grid>
                            
                    	<Grid x:Name="gridLoading" Visibility="Collapsed" Margin="0,0,0,215" VerticalAlignment="Bottom" Height="0">
                    		<StackPanel>
                    			<Label Content="Loading ..."/>
                    		</StackPanel>
                    	</Grid>
                    </Grid>
                        
    			</Grid>
            </Border>
        </Border>
    </Grid>
</Page>
